package cn.HuanG.config;

import cn.HuanG.base.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//@Configuration
public class LoginConfig implements WebMvcConfigurer {
    @Autowired
    private LoginInterceptor  loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //开启拦截
        registry.addInterceptor(loginInterceptor)
                //配置拦截内容
                .addPathPatterns("/**")
                //放行资源
                .excludePathPatterns("/login")
                .excludePathPatterns("/wxUser/**");
    }
}
